from django.conf import settings
import os.path as _path

def _get(attr, default=None):
    return getattr(settings, attr, default)

# PROFILES_MODEL_DIR should contain path to profiles directory
# Directory containing profiles should be a python package
# Default value is "multiprofiles/models/profiles/"
PROFILES_MODEL_DIR = _get(
    'PROFILES_MODEL_DIR',
    _path.join(
        _path.dirname(_path.abspath(__file__)), 'profiles'
    )
)

# PROFILES_INFO is a typle of pairs (id, verbose_name), e.g.
# >> PROFILES_INFO = {
# >>     'amanita': _('Poisonous Amanita')
# >>     'deathcup': _('Psychodelic Death Cup')
# >> }
# It is used to init '<UserModel>.profile_type' field choices
PROFILES_INFO = _get('PROFILES_INFO', ())

# PROFILES_MODELS is dictionary with keys as profile id and
# values as profile model, e.g.
# >> PROFILES_MODELS = {
# >>     'amanita': 'mushrooms.AmanitaProfile'
# >>     'deathcup': 'mushrooms.DeathCupProfile'
# >> }
# Leave this variable empty to enable profiles autodiscover
PROFILES_MODELS = _get('PROFILES_MODELS', {})

# PROFILES_USER_MODEL is a string containing '<app>.<user model>'
# By default if you are not using any custom User model,
# multiprofiles internal ProfiledUser will be used
PROFILES_USER_MODEL = _get('PROFILES_USER_MODEL', 'auth.User')